package com.itheima.controller;

import com.itheima.pojo.ClazzOption;
import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {
    //新建service对象
    @Autowired
    private ReportService reportService;

    //员工职位人数统计
    @GetMapping("/empJobData")
    public Result getEmpJobDate(){
        JobOption jobOption = reportService.getEmpJobDate();

        return Result.success(jobOption);
    }

    //员工性别人数统计
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map> genderList = reportService.getEmpGenderDate();
        return Result.success(genderList);
    }

    //学院学历统计
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map> degreeList = reportService.getStudentDegreeData();
        return Result.success(degreeList);
    }

    //班级人数统计
    @GetMapping("/studentCountData")
    public Result getStudentClazzData(){
        ClazzOption clazzOption = reportService.getStudentClazzData();
        return Result.success(clazzOption);
    }


}
